package com.atguigu.gmall.product.service.impl;

import com.atguigu.gmall.model.product.BaseTrademark;
import com.atguigu.gmall.product.mapper.BaseTrademarkMapper;
import com.atguigu.gmall.product.service.BaseTrademarkService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Author atguigu-mqx
 * @Description TODO
 * @Date 2023/7/7 15:25
 * @Version 1.0
 */
@Service
public class BaseTrademarkServiceImpl extends ServiceImpl<BaseTrademarkMapper,BaseTrademark> implements BaseTrademarkService {


    @Autowired
    private BaseTrademarkMapper baseTrademarkMapper;

    @Override
    public IPage getBaseTradeMarkList(Page<BaseTrademark> baseTrademarkPage) {
        //  构建一个排序条件
        LambdaQueryWrapper<BaseTrademark> baseTrademarkLambdaQueryWrapper = new LambdaQueryWrapper<>();
        baseTrademarkLambdaQueryWrapper.orderByDesc(BaseTrademark::getId);
        //  返回数据
        return baseTrademarkMapper.selectPage(baseTrademarkPage,baseTrademarkLambdaQueryWrapper);

    }
}
